During working and living, people are exposed to a lot of images of natural scene images including text (text may be regarded as a character string). The text includes abundant information. For example, all of a product number included in a photograph of a product label, a license plate number included in a photograph of a vehicle license plate, a road number included in a photograph of a road sign, a product name and an advertising message included in a photograph of an advertising sign, and the like include text, and automatically obtaining text information in the natural scene images can help people more effectively understand and apply the images. Therefore, recognizing the text information has a very important practical value. For example, recognizing a vehicle license plate may be applied to traffic management, and so on.
Currently, when a character string in a natural scene image is extracted, a character string included in a natural scene image is first detected, character strings whose gaps satisfy a preset threshold may be separately divided to obtain image blocks including the character strings, and then, the character strings in the image blocks obtained by division may be separately recognized. A method for recognizing a character string in an image block is usually that: technical personnel may pre-store a lot of reference image blocks, the reference image blocks include different character strings, matching degrees between a target image block and the reference image blocks are calculated, and a character string included in a reference image block having the highest matching degree is used as a character string recognition result of the target image block. Therefore, to ensure a favorable recognition result, a lot of reference image blocks need to be stored, resulting in low calculation efficiency. For the foregoing problem, currently, another method is dividing a character string in a target image block according to characters, and a single character after the division is recognized, so that a quantity of stored reference image blocks is reduced.